#include<stdio.h>
int main()
{
    int a,b,c,d,e;
    for(a = 0;a <= 1;a++)
    {
        for(b = 0;b <= 1;b++)
        {
            for(c = 0;c <= 1 ;c++)
            {
                for(d = 0;d <= 1;d++)
                {
                    for(e = 0;e <= 1;e++)
                    {
                        if((a&&b+c+d+e == 3||!a&&b+c+d+e != 3)
                            &&(b&&a+c+d+e == 0||!b&&a+c+d+e != 0)
                            &&(c&&b+a+d+e == 1||!c&&b+a+d+e != 1)
                            &&(d&&b+c+a+e == 4||!d&&b+c+a+e != 4))
                        {
                            printf("A is pasted apiece of %s paper on his forehead.\n",a ? "white" : "black");
                            printf("B is pasted apiece of %s paper on his forehead.\n", b ? "white" : "black");
                            printf("C is pasted apiece of %s paper on his forehead.\n",c ? "white" : "black");
                            printf("D is pasted apiece of %s paper on his forehead.\n",d ? "white" : "black");
                            printf("E is pasted apiece of %s paper on his forehead.\n",e ? "white" : "black");
                        }
                    }
                }
            }
        }
    }


    return 0;

}

//熊贤豪